/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.bayu.services.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Bayu
 */
@Entity
@Table(name = "new_item")
@NamedQueries({@NamedQuery(name = "NewItem.findAll", query = "SELECT n FROM NewItem n"), @NamedQuery(name = "NewItem.findById", query = "SELECT n FROM NewItem n WHERE n.id = :id"), @NamedQuery(name = "NewItem.findByPartName", query = "SELECT n FROM NewItem n WHERE n.partName = :partName"), @NamedQuery(name = "NewItem.findByPartNumber", query = "SELECT n FROM NewItem n WHERE n.partNumber = :partNumber"), @NamedQuery(name = "NewItem.findByCustomer", query = "SELECT n FROM NewItem n WHERE n.customer = :customer"), @NamedQuery(name = "NewItem.findByDate", query = "SELECT n FROM NewItem n WHERE n.date = :date")})
public class NewItem implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Long id;
    @Basic()
    @Column(name = "part_name")
    private String partName;
    @Basic()
    @Column(name = "part_number")
    private String partNumber;
    @Basic()
    @Column(name = "customer")
    private String customer;
    @Basic()
    @Column(name = "date")
    @Temporal(TemporalType.DATE)
    private Date date;

    public NewItem() {
    }

    public NewItem(Long id) {
        this.id = id;
    }

    public NewItem(Long id, String partName, String partNumber, String customer, Date date) {
        this.id = id;
        this.partName = partName;
        this.partNumber = partNumber;
        this.customer = customer;
        this.date = date;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getPartName() {
        return partName;
    }

    public void setPartName(String partName) {
        this.partName = partName;
    }

    public String getPartNumber() {
        return partNumber;
    }

    public void setPartNumber(String partNumber) {
        this.partNumber = partNumber;
    }

    public String getCustomer() {
        return customer;
    }

    public void setCustomer(String customer) {
        this.customer = customer;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NewItem)) {
            return false;
        }
        NewItem other = (NewItem) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bayu.services.entity.NewItem[id=" + id + "]";
    }

}
